import request from '@/utils/request'

// 查询通信录列表
export function listContacts(query) {
  return request({
    url: '/allocation/contacts/list',
    method: 'get',
    params: query
  })
}

// 查询通信录详细
export function getContacts(id) {
  return request({
    url: '/allocation/contacts/' + id,
    method: 'get'
  })
}

// 新增通信录
export function addContacts(data) {
  return request({
    url: '/allocation/contacts',
    method: 'post',
    data: data
  })
}

// 修改通信录
export function updateContacts(data) {
  return request({
    url: '/allocation/contacts',
    method: 'put',
    data: data
  })
}

// 删除通信录
export function delContacts(id) {
  return request({
    url: '/allocation/contacts/' + id,
    method: 'delete'
  })
}

// 消息状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/allocation/contacts/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询用户--角色详细
export function getRole(id) {
  return request({
    url: '/allocation/role/' + id,
    method: 'get'
  })
}
